home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2953 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: bcfreenet.seflin.lib.fl.us!bcfreenet!z007400b
  2. From: z007400b@bcfreenet.seflin.lib.fl.us (Ralph Silverman)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Passing multidimensional arrays to functions in C
  5. Date: 24 Jan 1996 20:47:55 GMT
  6. Organization: SEFLIN Free-Net - Broward
  7. Message-ID: <4e65tr$619@bcfreenet.seflin.lib.fl.us>
  8. References: <vijay-2301961215460001@vijay.chinalake.navy.mil>
  9. NNTP-Posting-Host: bcfreenet.seflin.lib.fl.us
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Jim Vijay (vijay@nawc690.chinalake.navy.mil) wrote:
  13. : The C FAQ (Q's 6.16 thru 6.20) explains how to pass 2D arrays to functions
  14. : in C.  None of the methods shown is as simple or general as languages such
  15. : as (gasp!) FORTRAN.
  16.  
  17. : While realizing that I'm inviting flames, and realizing this topic
  18. : may have been discussed to death in the past (but not in the FAQ),
  19. : let me ask:
  20.  
  21. :    What would break (or even be damaged) in C if the language allowed
  22. :    one to pass the width of a 2D array (in general, n-1 dimensions of
  23. :    an n dim array) to a function?  It should be easy for a compiler to
  24. :    emit code that dynamically depends on these n-1 dimensions. 
  25. :    FORTRAN (IV?) at the time of C's birth could do it!
  26.  
  27. : Please note that I'm not asking how the C language defines and uses multi
  28. : dimensional array parameters to functions.  I would like to know _why_ the
  29. : current mechanism was chosen - initially (by K&R?) and later by the ANSI
  30. : C committees.
  31.  
  32. : Thanks.
  33.  
  34. --
  35. *********begin r.s. response**********
  36.  
  37.     "...allowed one to pass..."
  38.     ???
  39.     of course,
  40.     pass them if you want!
  41.  
  42. *********end r.s. response************
  43. Ralph Silverman
  44. z007400b@bcfreenet.seflin.lib.fl.us
  45.  
  46.